package tech.ezrealc.fall2023.model.common;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ResponseModel {

    private Integer code;
    private String message;
    private Object data;

    public static ResponseModel success(String message) {
        return new ResponseModel(0, message, null);
    }

    public static ResponseModel success(Object data) {
        return new ResponseModel(0, "success", data);
    }

    public static ResponseModel success(){
        return new ResponseModel(0, "success", null);
    }

    public static ResponseModel failure(String message) {
        return new ResponseModel(-1, message, null);
    }

}
